
package com.hlkj.pay.enums;

import lombok.Getter;

/**
 * @author HlpayTeam
 * @date 2024/09/06 18:20
 */
public interface AdEnum {

    @Getter
    enum STATISTICS_TYPE {

        VIEW(0, "浏览页面"), SUBMIT_ORDER(1, "提交订单"), PAY_ORDER(2, "支付订单"), REFUND_ORDER(3, "订单退款"), CALL_ORDER(4, "订单回传"),

        ;

        /**
         * 错误码
         */
        private Integer code;

        /**
         * 错误提示
         */
        private String msg;

        STATISTICS_TYPE(Integer code, String msg) {
            this.code = code;
            this.msg = msg;
        }

        public static STATISTICS_TYPE from(Integer key) {
            STATISTICS_TYPE[] values = STATISTICS_TYPE.values();
            for (STATISTICS_TYPE deliveryType : values) {
                if (deliveryType.getCode().equals(key)) {
                    return deliveryType;
                }
            }
            return STATISTICS_TYPE.SUBMIT_ORDER;
        }
    }

    @Getter
    enum STATISTICS_DIM_TYPE {

        TWO_MINUTE(1, 2, "2分钟"),
        FIVE_MINUTE(2, 5, "5分钟"), TEN_MINUTE(3, 10, "10分钟"),ONE_HOUR(4, 60, "1小数"),ONE_DAY(5, 60*24, "1天"),

        ;

        /**
         * 错误码
         */
        private Integer code;

        /**
         * 分钟
         */
        private Integer minute;

        /**
         * 错误提示
         */
        private String msg;

        STATISTICS_DIM_TYPE(Integer code, Integer minute, String msg) {
            this.code = code;
            this.minute = minute;
            this.msg = msg;
        }

        public static STATISTICS_DIM_TYPE from(Integer key) {
            STATISTICS_DIM_TYPE[] values = STATISTICS_DIM_TYPE.values();
            for (STATISTICS_DIM_TYPE deliveryType : values) {
                if (deliveryType.getCode().equals(key)) {
                    return deliveryType;
                }
            }
            return STATISTICS_DIM_TYPE.FIVE_MINUTE;
        }
    }

   
    @Getter
    enum AD_TYPE {
        
        TELE_BILL(1, "phone-bill","话费"), SHORT_DRAMA(2, "short-play","短剧"),

        ;

        /**
         * 错误码
         */
        private Integer code;
        /**
         * 错误码
         */
        private String prefix;

        /**
         * 错误提示
         */
        private String msg;
        
        AD_TYPE(Integer code, String prefix,String msg) {
            this.code = code;
            this.msg = msg;
            this.prefix = prefix;
        }

        public static AD_TYPE from(Integer key) {
            AD_TYPE[] values = AD_TYPE.values();
            for (AD_TYPE deliveryType : values) {
                if (deliveryType.getCode().equals(key)) {
                    return deliveryType;
                }
            }
            return AD_TYPE.TELE_BILL;
        }
    }
    
}
